package cn.bigway.app.weavingdesigner.main;

import java.awt.FlowLayout;
import java.util.EnumSet;

import javax.swing.Icon;

import cn.bigway.app.weavingdesigner.Resources;
import cn.bigway.app.weavingdesigner.action.WdActionFactory;
import cn.bigway.app.weavingdesigner.swing.WdPanel;
import cn.bigway.app.weavingdesigner.type.WdMenuItemType;
import cn.bigway.app.weavingdesigner.type.WdViewTabType;

final class WdViewTab extends WdPanel {

	private static final long serialVersionUID = -1180989851529737380L;
	private WdViewTabType type;

	public WdViewTab(WdViewTabType type, EnumSet<WdMenuItemType> itemTypes) {
		setLayout(new FlowLayout());
		this.type = type;
		for (WdMenuItemType itemType : itemTypes) {
			add(WdActionFactory.getInstance().createButton(itemType));
		}
	}

	public String getTitle() {
		return Resources.getString(this.type, "title");
	}

	public Icon getIcon() {
		return null;
	}

	public String getTip() {
		return Resources.getString(this.type, "tip");
	}
}
